<template>
  <div style="height: 100%;">
    <el-container style="height: 100%; min-height: 100vh;">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)" height=100%>
       <AsideMenu :isCollapse="isCollapse" :logoTextShow="logoTextShow"/>
      </el-aside>
      
      <el-container>
        <el-header style=" border-bottom: 1px solid #ccc;">
          <HeaderMenu :collapseBtnClass="collapseBtnClass" :collapse="isCollapse"/>
        </el-header>
        
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
// import request from '@/utils/request';
import AsideMenu from '@/components/AsideMenu.vue';
import HeaderMenu from '@/components/HeaderMenu.vue';

  export default {
    data() {
      
      return {
        msg:"hello",
        collapseBtnClass:'el-icon-s-fold',
        isCollapse:false,
        sideWith:200,
        logoTextShow:true
      }
    },

    // created(){
    //   //加载初始数据
    //   this.load()
    // },

    components:{
      AsideMenu,
      HeaderMenu,
    },


    methods:{
      collapse(){
        this.isCollapse=!this.isCollapse
        if(this.isCollapse){ //收缩
          this.sideWith=64
          this.collapseBtnClass='el-icon-s-unfold'
          this.logoTextShow=false;
        }
        else{ //展开
          this.sideWith=200
          this.collapseBtnClass='el-icon-s-fold'
          this.logoTextShow=true
        }
      } ,

    }
  };
</script>

<style>
  .el-header {
    /* background-color: #B3C0D1; */
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }

  .headerBg{
    background: #eee !important;
  }

</style>